﻿<UserControl x:Class="PodThrower.View.DocumentView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:wtk="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
    >
	<DockPanel>
		<ToolBarTray DockPanel.Dock="Top">
			<ToolBar>
				<Button ToolTip="Reconnect" Command="{Binding ConnectCommand}">
					<Image Source="/PodThrower;component/Images/connect.png" />
				</Button>
				<Button ToolTip="Add" Command="{Binding AddCommand}">
					<Image Source="/PodThrower;component/Images/rss_add.png" />
				</Button>
				<Button ToolTip="Close" Command="{Binding CloseCommand}">
					<Image Source="/PodThrower;component/Images/delete.png" />
				</Button>
			</ToolBar>
		</ToolBarTray>
		<wtk:DataGrid ItemsSource="{Binding Feeds}"
			HorizontalGridLinesBrush="LightGray"
			VerticalGridLinesBrush="LightGray"
			AlternationCount="2"
			AutoGenerateColumns="False"
			AlternatingRowBackground="#FFEEEEEE"
			IsSynchronizedWithCurrentItem="True"
			SelectionMode="Single"
			CanUserAddRows="False" >			
			<wtk:DataGrid.Columns>
				<wtk:DataGridTextColumn Header="ID" Binding="{Binding ID}" IsReadOnly="True" />
				<wtk:DataGridTextColumn Header="Title" Binding="{Binding Title}" />
				<wtk:DataGridTemplateColumn Header="Folder">
					<wtk:DataGridTemplateColumn.CellTemplate>
						<DataTemplate>
							<StackPanel Orientation="Horizontal">
								<TextBox Text="{Binding Folder}" Width="150" />
								<Button Content="..." Command="{Binding ChooseFolderCommand}" />
							</StackPanel>
						</DataTemplate>
					</wtk:DataGridTemplateColumn.CellTemplate>
				</wtk:DataGridTemplateColumn>
				<wtk:DataGridTemplateColumn Header="Image">
					<wtk:DataGridTemplateColumn.CellTemplate>
						<DataTemplate>
							<StackPanel Orientation="Horizontal">
								<TextBox Text="{Binding Image}" Width="150" />
								<Button Content="..." Command="{Binding ChooseImageCommand}" />
							</StackPanel>
						</DataTemplate>
					</wtk:DataGridTemplateColumn.CellTemplate>
				</wtk:DataGridTemplateColumn>
				<wtk:DataGridTextColumn Header="File Filter" Binding="{Binding Filter}" />
				<wtk:DataGridTextColumn Header="Feed URL" Binding="{Binding FeedURL}" IsReadOnly="True" />
				<wtk:DataGridTemplateColumn Header="Actions">
					<wtk:DataGridTemplateColumn.CellTemplate>
						<DataTemplate>
							<StackPanel Orientation="Horizontal">
								<Button ToolTip="Copy Feed URL" Command="{Binding CopyFeedCommand}">
									<Image Source="/PodThrower;component/Images/page_copy.png" />
								</Button>
								<Button ToolTip="Remove Feed" Command="{Binding RemoveFeedCommand}">
									<Image Source="/PodThrower;component/Images/delete.png" />
								</Button>
							</StackPanel>
						</DataTemplate>
					</wtk:DataGridTemplateColumn.CellTemplate>
				</wtk:DataGridTemplateColumn>				
			</wtk:DataGrid.Columns>
		</wtk:DataGrid>
	</DockPanel>
</UserControl>
